function debounce(callback, time) {
    let timeID = null
    return function(e) {
        if (timeID !== null) {
            clearInterval(timeID)
        }
        timeID = setTimeout(() => {
            callback.call(this, e)
            timeID = null
        }, time)

    }
}